<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
    <meta http-equiv="Content-Type" content="text/HTML; charset=utf-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <script type="text/javascript">
        function doLocation(url) {
            history.pushState({},"t","#"); 
    		var f = document.createElement("iframe");
			f.style.display = "none";
			document.body.appendChild(f);
            setTimeout(function(){
                f.src = url;
            }, 100);
        }
    </script>
</head>
<body>
 
<script type="text/javascript">
var getUrlParam = function(obj, strParamName) {
	//@obj : ��ȡ�����Ķ���(a , img , documentʱ��ȡlocation.href)
	//@strParamName : ������
	var getQueryStrByName = function(val, name) {
		var result = val.match(new RegExp("[?&]" + name + "=([^&]+)", "i"));
		if (result == null || result.length < 1) {
			return "";
		}
		return result[1];
	};

	strParamName = escape(unescape(strParamName));
	if (toString.call(obj) == '[object String]') {
		return getQueryStrByName(obj, strParamName);
	} else if (obj.nodeName == '#document') {
		return getQueryStrByName(location.search || '', strParamName);
	} else if (typeof obj.src != 'undefined') {
		return getQueryStrByName(obj.src, strParamName);
	} else if (typeof obj.href != 'undefined') {
		return getQueryStrByName(obj.href, strParamName);
	} else {
		return null;
	}
};
		var agent_str = navigator.userAgent;
		var addParam = getUrlParam(document, 'a');
		if(agent_str.indexOf("iPhone") > -1 ){
		  document.write('<meta content="width=device-width,initial-scale=0.5,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">');
		}else if(agent_str.indexOf("iPad") >-1){
		  document.write('<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">');
		}else if(agent_str.indexOf("iPod") >-1){
		  document.write('<meta content="width=device-width,initial-scale=0.5,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">');
		}else if(agent_str.indexOf("android") >-1){
		  document.write('<meta content="width=device-width,initial-scale=0.5,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">');
		}  
		//itunes.apple.com/cn/app/xiao-xiao-san-guo-zhi/id947712436?mt=8
        doLocation('itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/search?submit=edit&term='+(addParam||'')+'&media=software&clientApplication=Software');
</script>
</body>
</html>